home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pascal Super Library
/
Pascal Super Library (CW International)(1997).bin
/
DELPHI32
/
DATETIME
/
TIMESTOP
/
TIMESTOP.ZIP
/
TimeStop.pas
< prev
Wrap
Pascal/Delphi Source File
|
1996-07-11
|
1KB
|
76 lines
unit TimeStop;
{
Copyriht Bj°rn M. Jacobsen 1996
Bjorn Jacobsen <Safetec @ internet.no>
This component is FREEWARE .
}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TTimeStop = class(TComponent)
private
FDate:string;
{ Private declarations }
protected
{ Protected declarations }
public
constructor Create(AOwner : TComponent); override;
Destructor Destroy;override;
procedure Execute;
{ Public declarations }
published
property Date :string read Fdate write FDate ;
property Name;
Property Tag;
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Samples', [TTimeStop]);
end;
constructor TTimeStop.Create(AOwner : TComponent);
begin
inherited Create(AOwner);
FDate:='31,12,99';
end;
Destructor TTimestop.Destroy;
begin
inherited Destroy ;
end;
procedure TTimestop.Execute;
var fra,tid2,dag:string[20];
begin
tid2:=FormatDateTime('yy,mm,dd',now);
dag:=tid2[1]+tid2[2]+tid2[4]+tid2[5]+tid2[7]+tid2[8]; // formats like'991231'
if length(FDATE)>10 then Fdate:='31,12,99';
fra:=Fdate[7]+Fdate[8]+Fdate[4]+Fdate[5]+Fdate[1]+Fdate[2]; // formats like'991231'
if strtoint(dag)>=strtoint(fra) then begin
application.messagebox(' Now is the time to PAY...','TimeStop.',mb_ok);
application.terminate;
end;
end;
end.